package design;

public class Singleton {
    public static void main(String[] args) {
        MySingleton singleton = MySingleton.getINSTANCE();
        singleton.sayHi();
    }
}
class MySingleton{
//  private static MySingleton instance = new MySingletron();

    private static final MySingleton INSTANCE = new MySingleton();

    private MySingleton(){

    }

    public static MySingleton getINSTANCE() {
        return INSTANCE;
    }

    public void sayHi(){
        System.out.println("大家好，我是MySingleton的方法");
    }


}